$OpenBSD: patch-Makefile_in,v 1.2 2016/01/19 03:41:50 bentley Exp $
--- Makefile.in.orig	Mon Jan 18 20:34:38 2016
+++ Makefile.in	Mon Jan 18 20:34:59 2016
@@ -625,9 +625,10 @@ $(PREFIX2).mode: modes.xml 
 
 install-data-local:
 	apertium-gen-modes modes.xml apertium-$(PREFIX1)
-	$(INSTALL_DATA) $(PREFIX1).mode $(apertium_fr_modesdir)
-	$(INSTALL_DATA) $(PREFIX2).mode $(apertium_fr_modesdir)
-	$(INSTALL_DATA) $(BASENAME).$(PREFIX2).t1x $(BASENAME).$(PREFIX1).t1x $(apertium_fr_cadir)
+	test -d $(DESTDIR)$(apertium_fr_modesdir) || mkdir $(DESTDIR)$(apertium_fr_modesdir)
+	$(INSTALL_DATA) $(PREFIX1).mode $(DESTDIR)$(apertium_fr_modesdir)
+	$(INSTALL_DATA) $(PREFIX2).mode $(DESTDIR)$(apertium_fr_modesdir)
+	$(INSTALL_DATA) $(BASENAME).$(PREFIX2).t1x $(BASENAME).$(PREFIX1).t1x $(DESTDIR)$(apertium_fr_cadir)
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
